package com.tingyuge.base.thread.wang.chapter2;

import java.util.Random;

/**
 * Created by xiaodao
 * date: 2019/11/28
 */
public class TicketWindowRunable implements Runnable {

    private int index =1;
    private int MAX = 50;

    @Override
    public void run() {
        while (index <= 50){
            System.out.println(Thread.currentThread().getName() +"  售出: "+ (index++));
            try {
                Thread.sleep(new Random().nextInt(1000));
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
